Skip to content

feat: introduce renderer plugin architecture and renderer packages#511

Open
islxyqwe wants to merge 33 commits intomainfrom
codex/plugin
Open

feat: introduce renderer plugin architecture and renderer packages#511
islxyqwe wants to merge 33 commits intomainfrom
codex/plugin

Conversation

@islxyqwe
Copy link
Copy Markdown
Member

@islxyqwe islxyqwe commented Apr 14, 2026

Background

This PR upgrades Graphic Walker rendering from a single built-in implementation to a plugin-based architecture, and introduces Observable Plot and ECharts as standalone renderer packages. The goals are to support extensible renderers, reduce coupling in the core package, and preserve compatibility with legacy renderer IDs.

What’s included

1) Renderer Plugin architecture (core)

  • Added renderer plugin registry APIs and types in @kanaries/graphic-walker:
    • registerRendererPlugin
    • unregisterRendererPlugin
    • getRendererPlugin
    • listRendererPlugins
    • registerRendererAlias
    • resolveRendererId
  • Added built-in builtin:vega plugin and auto-registration during package initialization.
  • Added renderer alias compatibility: vega-lite -> builtin:vega.

2) Standalone renderer packages

  • Added @kanaries/graphic-walker-renderer-observable-plot.
  • Added @kanaries/graphic-walker-renderer-echarts.
  • Both can be injected into GraphicRenderer or GraphicWalker via createXxxPlugin().

3) Plugin injection and fallback in rendering entry points

  • GraphicRenderer / SpecRenderer / PureRenderer now accept rendererPlugins.
  • Renderer selection resolves from layout.renderer; if a plugin is missing or fails canRender, it falls back to builtin:vega.
  • Existing geographic rendering path (Leaflet) remains unaffected.

4) Documentation updates

  • Added a Renderer Plugins section in README with examples for:
    • registerRendererPlugin(createObservablePlotPlugin())
    • registerRendererPlugin(createEChartsPlugin())
  • Documented legacy renderer ID compatibility for smooth upgrades.

5) Engineering and release support

  • Added renderer plugin release workflow: .github/workflows/release-renderer-plugin.yml.
  • Updated playground demos with renderer switching (VegaLite / Observable Plot / ECharts).
  • Enhanced chart field configuration capabilities (new field config dialog), including title override, sorting strategy, and formatting options.

Compatibility

  • Existing configs with renderer: "vega-lite" continue to work.
  • If a third-party plugin is not registered, charts safely fall back to builtin:vega instead of failing.

Validation

  • Manually validated in playground:
    • Path: /examples/GraphicRenderer
    • Switched renderer to ECharts or Observable Plot and verified rendering works.
image image

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graphic-walker Ready Ready Preview, Comment Apr 15, 2026 11:49am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant